package ar.edu.unicen.exa.isistan.archassis.view.classes.classitem.classdata;

import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;

import swing2swt.layout.BorderLayout;

public class ClassDataComposite extends Composite {
	private Label lblNewLabel;
	private Button btnExtiendeDe;

	/**
	 * Create the composite.
	 * @param parent
	 * @param style
	 */
	public ClassDataComposite(Composite parent) {
		super(parent, SWT.BORDER);
		setLayout(new BorderLayout(0, 0));
		
		lblNewLabel = new Label(this, SWT.NONE);
		lblNewLabel.setLayoutData(BorderLayout.EAST);
		lblNewLabel.setText(" ");
		
		Composite composite = new Composite(this, SWT.NONE);
		composite.setLayoutData(BorderLayout.EAST);
		composite.setLayout(new FillLayout(SWT.HORIZONTAL));
		
		btnExtiendeDe = new Button(this, SWT.FLAT | SWT.CHECK);
		
		
		//btnExtiendeDe.setBackground(SWTResourceManager.getColor(SWT.COLOR_WIDGET_LIGHT_SHADOW));
		
		btnExtiendeDe.setText("Extiende de");
		btnExtiendeDe.setLayoutData(BorderLayout.CENTER);
		btnExtiendeDe.setSelection(false);
		
		

	}
	
	
	
	@Override
	public void setEnabled(boolean enabled) {
		// TODO Auto-generated method stub
		super.setEnabled(enabled);
		btnExtiendeDe.setEnabled(enabled);
		System.out.println(value + ":" + enabled);
	}



	public boolean isChecked() {
		return btnExtiendeDe.getSelection();
	}

	@Override
	protected void checkSubclass() {
		// Disable the check that prevents subclassing of SWT components
	}
	
	private String key;
	private String value;

	
	public void setValue(String key, String value) {
		this.btnExtiendeDe.setText(key + " '" + value + "'");
		this.key = key;
		this.value = value;
	}
	public String getValue() {
		return this.value;
	}
}
